import { createRouter, createWebHistory } from 'vue-router'
import Login from "@/views/Login.vue";


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      redirect: '/login',//重定向
    },
    {
      path:'/login',
      name: 'login',
      component: Login
    },
    {
      path: '/main',
      name: 'main',
      component:()=>import('@/views/Main.vue'),
      children:[
        {
          path: '',
          component:()=>import('@/views/Home.vue')
        },
        {
          path:'settings',
          component:()=>import('@/views/Settings.vue')
        }
      ]
    },

  ],
})

export default router
